package com.shiva.oms.logview.domain;

import com.sf.shiva.oms.common.util.UUIDGenerator;

/**
 * 
 * 登录linux服务器的连接配置信息
 * 
 * <pre>
 * HISTORY
 * ****************************************************************************
 *  ID    DATE            PERSON            REASON
 *  1     2018年4月16日         LA.01367604           Create
 * ****************************************************************************
 * </pre>
 * 
 * @author LA.01367604
 * @version 1.0
 */
public class ConnectCfg extends CustomTemp2Local {

    private String cfgName;
    private String ip;
    private String user;
    private String password;
    private String fileDir;

    public ConnectCfg() {
        this.id = UUIDGenerator.generate();
    }
    public ConnectCfg(String id, String cfgName, String ip, String user, String password, String fileDir) {
        this.id = id;
        this.cfgName = cfgName;
        this.ip = ip;
        this.user = user;
        this.password = password;
        this.fileDir = fileDir;
    }
    public ConnectCfg(String cfgName, String ip, String user, String password, String fileDir) {
        this(UUIDGenerator.generate(),cfgName,ip,user,password,fileDir);
    }

    public String getCfgName() {
        return cfgName;
    }

    public void setCfgName(String cfgName) {
        this.cfgName = cfgName;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFileDir() {
        return fileDir;
    }

    public void setFileDir(String fileDir) {
        this.fileDir = fileDir;
    }

    @Override
    public String toString() {
        return this.id + "," + this.cfgName + "," + this.ip + "," + this.user + "," + this.password
                + "," + this.fileDir;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || this.getClass() != obj.getClass())
            return false;
        ConnectCfg newObj = (ConnectCfg) obj;
        return this.getCfgName().equals(newObj.getCfgName()) && this.getIp().equals(newObj.getIp())
                && this.getUser().equals(newObj.getUser())
                && this.getPassword().equals(newObj.getPassword())
                && this.getFileDir().equals(newObj.getFileDir());
    }
}
